package com.springmvc.utils.result;

import java.io.Serializable;

public class ResultMsg<T> implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2497393519640031346L;

	/**
	 * 认证是否成功，
	 */
	private boolean			  success;

	/**
	 * 认证失败的错误代码。
	 */
	private String			  code;

	/**
	 * 认证失败的错误提示信息键值。
	 */
	private String			  msg;

	/**
	 * 其他信息
	 */
	private T				  data;

	public ResultMsg() {
		this.setCode("");
		this.setMsg("");
		this.setSuccess(false);
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public ResultMsg(boolean success, String code, String msg, T data) {
		this.data = data;
		this.setCode(code);
		this.setMsg(msg);
		this.setSuccess(success);
	}
}
